﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CardFormatter
{
    public partial class BasicSettingsForm : Form
    {
        public BasicSettingsForm()
        {
            InitializeComponent();
        }
        public delegate void OkEventDelegate();
        public event OkEventDelegate OkEvent;

        private void AcceptBtn_Click(object sender, EventArgs e)
        {
            int width = int.Parse(widthTxt.Text);
            int height = int.Parse(heightTxt.Text);
            MainForm.basicSettings.SetSettings(width, height);
            OkEvent?.Invoke();
            this.Close();
        }

        private void RstBtn_Click(object sender, EventArgs e)
        {
            widthTxt.Text = "10";
            heightTxt.Text = "10";
        }

        private void BasicSettingsForm_Load(object sender, EventArgs e)
        {
            int width = MainForm.basicSettings.Settings[0];
            int height = MainForm.basicSettings.Settings[1];
            widthTxt.Text = width.ToString();
            heightTxt.Text = height.ToString();
        }
    }
}
